package com.lanou.pianke.admin.service.impl;

import com.lanou.pianke.admin.entity.Pcomment;
import com.lanou.pianke.admin.mapper.PcommentMapper;
import com.lanou.pianke.admin.service.PcommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PcommentServiceImpl implements PcommentService {
    @Autowired
    private PcommentMapper pcommentMapper;

    @Override
    public List<Pcomment> showAll() {
        return pcommentMapper.selectAll();
    }

    @Override
    public List<Pcomment> showReported() {
        return pcommentMapper.selectReported();
    }

    @Override
    public void deletePcomment(String pcommentId) {
        pcommentMapper.updateByPcommentId(pcommentId);
    }


    @Override
    public void deleteCommentByReported() {
        pcommentMapper.updateStatusByReported();
    }

    @Override
    public void deleteByPieceid(String pieceid) {
        pcommentMapper.updateByPieceid(pieceid);
    }

    @Override
    public String showPcommentIdByPieceid(String pieceid) {
        return pcommentMapper.selectByPieceid(pieceid);
    }

    @Override
    public void deleteByUid(Long uid) {
        pcommentMapper.updateByUid(uid);
    }


}
